improve support for testo running from alternate directories.
authortsteven4 <tsteven4@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 1 Sep 2013 13:19:35 +0000 (13:19 +0000)
committertsteven4 <tsteven4@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 1 Sep 2013 13:19:35 +0000 (13:19 +0000)
gpsbabel/testo
gpsbabel/testo.d/text.test
gpsbabel/testo.d/tpo.test
gpsbabel/testo.d/unicsv.test
gpsbabel/testo.d/xol.test

index 755d52b0affbf33437e48b264158cacc02131bc2..faef2dad6618d332a52087df01195d0dea72990d 100755 (executable)
@@ -11,9 +11,9 @@ export MALLOC_CHECK_
 LC_ALL=en_US.UTF-8
 export LC_ALL
 
-PNAME=${PNAME:-./gpsbabel}
-DIFF=${DIFF:-diff}
 BASEPATH=`dirname $0`
+PNAME=${PNAME:-${BASEPATH}/gpsbabel}
+DIFF=${DIFF:-diff}
 REFERENCE=${BASEPATH}/reference
 # OD=${OD:-od -Ax -txC -v}
 if [ -x /usr/bin/hexdump ] ; then
index a81ca86c8311b860777971dabf49861145b5d559..0edef26c464e56f38f122f7b0bf39c98b167f139 100644 (file)
@@ -1,5 +1,5 @@
 #  Test HTML and Text output of a geocache.
 
-gpsbabel -i gpx -f reference/gc/GCGCA8.gpx -o html -F ${TMPDIR}/gc.html -o text -F ${TMPDIR}/gc.txt
-compare reference/gc/GCGCA8~text.txt ${TMPDIR}/gc.txt
-compare reference/gc/GCGCA8~html.txt ${TMPDIR}/gc.html
+gpsbabel -i gpx -f ${REFERENCE}/gc/GCGCA8.gpx -o html -F ${TMPDIR}/gc.html -o text -F ${TMPDIR}/gc.txt
+compare ${REFERENCE}/gc/GCGCA8~text.txt ${TMPDIR}/gc.txt
+compare ${REFERENCE}/gc/GCGCA8~html.txt ${TMPDIR}/gc.html
index 3a774d1d589e8c8bc2b0dcca752b0213b973cc69..b31701fe696013d4afb9f5b98171861677f2d695 100644 (file)
@@ -9,8 +9,8 @@
 rm -f ${TMPDIR}/tpo-sample1.gpx ${TMPDIR}/tpo-sample2.tpo
 gpsbabel -t -i tpo2 -f ${REFERENCE}/track/tpo-sample1.tpo -o gpx -F ${TMPDIR}/tpo-sample1.gpx
 compare ${REFERENCE}/track/tpo-sample1.gpx ${TMPDIR}/tpo-sample1.gpx
-#gpsbabel -t -i gpx -f reference/track/tpo-sample2.gpx -o tpo2 -F ${TMPDIR}/tpo-sample2.tpo
-#bincompare ${TMPDIR}/tpo-sample2.tpo reference/track/tpo-sample2.tpo
+#gpsbabel -t -i gpx -f ${REFERENCE}/track/tpo-sample2.gpx -o tpo2 -F ${TMPDIR}/tpo-sample2.tpo
+#bincompare ${TMPDIR}/tpo-sample2.tpo ${REFERENCE}/track/tpo-sample2.tpo
 #
 # Version 3.x tests.  Remove the timestamp from the generated file
 # so that the compare will succeed.
index 27232adcb4ca3c7cf03779aa3b1bf67ad51e76f9..0e17f66a5186a0ba71093030068687ba760672b8 100644 (file)
@@ -11,6 +11,6 @@ compare ${REFERENCE}/unicsv.gpx ${TMPDIR}/unicsv.gpx
 gpsbabel -i garmin_txt -f ${REFERENCE}/garmin_txt.txt -x nuketypes,routes,tracks -o unicsv -F ${TMPDIR}/garmin_txt-uni.csv
 compare ${REFERENCE}/garmin_txt-uni.csv ${TMPDIR}/garmin_txt-uni.csv 
 
-gpsbabel -i gpx -f reference/gc/GC7FA4.gpx -o unicsv,utc=0 -F ${TMPDIR}/gcunicsv-1.csv
-gpsbabel -i unicsv,utc=0 -f reference/gc/GC7FA4~unicsv.csv -o unicsv,utc=0 -F  ${TMPDIR}/gcunicsv-2.csv
+gpsbabel -i gpx -f ${REFERENCE}/gc/GC7FA4.gpx -o unicsv,utc=0 -F ${TMPDIR}/gcunicsv-1.csv
+gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/gc/GC7FA4~unicsv.csv -o unicsv,utc=0 -F  ${TMPDIR}/gcunicsv-2.csv
 compare ${TMPDIR}/gcunicsv-1.csv ${TMPDIR}/gcunicsv-2.csv
index d63f16cd543c99207134e88edb87b3dcef6925dc..b57aee7d422a112068eddf8d8fcc87e03eda8a3d 100644 (file)
@@ -16,6 +16,8 @@ ${PNAME} -i xol -f ${REFERENCE}/doesnotexist -o gpx -F ${TMPDIR}/xol-sample_si.g
          echo "${PNAME} succeeded! (it shouldn't have with this input...)"
 }
 # check error message is what we expected
+# Note that the reference file nonexistent.err includes the file path,
+# so this will fail when starting from a directory other than gpsbabel.
 compare ${REFERENCE}/nonexistent.err ${TMPDIR}/nonexistent.err